#include <GLFW/glfw3.h>
#include <curl/curl.h>
#include <iostream>
// 初始化 GLFW
void init_glfw() {
	if (!glfwInit()) {
		exit(EXIT_FAILURE);
	}
	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
	glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
	glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); //  窗口初始设置为隐藏
}

GLFWwindow* create_hidden_window(int width, int height) {
	GLFWwindow* window = glfwCreateWindow(width, height, "Hidden Window for Skia", NULL, NULL);
	if (!window) {
		glfwTerminate();
		exit(EXIT_FAILURE);
	}
	glfwMakeContextCurrent(window);
	return window;
}
int main() {
    // 初始化 GLFW
    init_glfw();
    create_hidden_window(100, 100);
    // 获取 OpenGL 版本信息
	const GLubyte* gl_version = glGetString(GL_VERSION);
	std::cout << "OpenGL Version: " << gl_version << std::endl;
    // 初始化 cURL
    curl_global_init(CURL_GLOBAL_ALL);

    // 获取 cURL 版本信息
    const char* version = curl_version();

    // 输出 cURL 版本信息
    std::cout << "CURL version: " << version << std::endl;

    // 清理 cURL
    curl_global_cleanup();
    // 退出前清理 GLFW
    glfwTerminate();
    std::cin.get();
    return 0;
}
